<template>
    <div>
        <pagetitle type="2"></pagetitle>
        <el-card class="box-card">
            <div class="teamTopTip">
                <el-icon color="#252B3A" size="16px"><Warning /></el-icon>
                <div class="tipbox">
                    <div class="tiptitle">温馨提示</div>
                    <div class="tipitem">“我的资源”包括您的原始资源及服务、购买的资源及服务</div>
                    <div class="tipitem">新增，更新，删除资源有一定时间的数据延迟，请稍候查看。</div>
                </div>
            </div>
        </el-card>
        <div class="teamBox">
            <div class="teamtop">
                <div class="left">
                    <el-input class="searchInput" v-model="queryData.companyName" placeholder="搜索视频监控开放平台" suffix-icon="Search" />
                    <el-button type="primary" @click="getCompanyList(0)" text bg>搜索</el-button>
                    <span>*搜索范围：平台名称、供应商名字、平台开发单位、支持模块型号等</span>
                </div>
                <div class="right">
                    <el-button type="primary" @click="topages('/digitalequipment/communicate/surveillancemsg?type=1')" text bg>新增</el-button>
                </div>
            </div>
            <div class="table">
                <el-table :data="tableData" style="width: 100%" class="configurationtable">
                    <el-table-column prop="name" label="序号" width="48">1</el-table-column>
                    <el-table-column label="开放平台名称"></el-table-column>
                    <el-table-column label="版本号"></el-table-column>
                    <el-table-column label="供应商名称"></el-table-column>
                    <el-table-column label="平台开发单位名称"></el-table-column>
                    <el-table-column label="支持模块型号"></el-table-column>
                    <el-table-column label="公开情况"></el-table-column>
                    <el-table-column label="操作">
                        <template #default>
                            <el-button type="primary" size="small" link @click="topages('/digitalequipment/communicate/surveillancemsg?type=2')"
                                >查看</el-button
                            >
                            <el-button type="primary" size="small" link @click="topages('/digitalequipment/communicate/surveillancemsg?type=3')"
                                >修改</el-button
                            >
                            <el-button type="primary" size="small" link>删除</el-button>
                        </template>
                    </el-table-column>
                </el-table>
                <pagination :totalNum="60"></pagination>
            </div>
        </div>
    </div>
</template>
<script lang="ts" setup>
import { ref, reactive } from "vue";
import { useRouter } from "vue-router";
// import { companyList } from "@/api/team";
const router = useRouter();
const pageData: any = reactive({
    records: [],
    total: 0,
});
const tableData = ref([{}]);
const queryData = reactive({
    companyName: "",
    checkState: "",
    startTime: "",
    endTime: "",
    page: 1,
    size: 10,
});
const input: any = [];
const checked: boolean = false;
const getCompanyList = (type: number) => {
    // type = 0 时为条件查询
    if (type) {
        queryData.companyName = "";
        queryData.checkState = "";
        queryData.startTime = "";
        queryData.endTime = "";
        queryData.page = 1;
    }
    // companyList(queryData).then((res: any) => {
    //     if (res.code == 200) {
    //         pageData.records = res.data.records;
    //         pageData.total = res.data.total;
    //     }
    // });
};

getCompanyList(1);
// 分页
const paginaClick = (val: number) => {
    queryData.page = val;
    getCompanyList(0);
};
const topages = (url: string) => {
    router.push(url);
};
</script>
<style lang="scss" scoped>
.teamTopTip {
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    .tipbox {
        margin-left: 10px;
        .tiptitle {
            font-size: 14px;
            color: #252b3a;
        }
        .tipitem {
            margin-top: 10px;
            font-size: 14px;
            color: #252b3a;
            display: flex;
            align-items: center;
        }
    }
}
.teamBox {
    margin-top: 20px;
    background-color: #ffffff;
    border-radius: 5px;
    box-shadow: var(--el-box-shadow-light);
    .teamtop {
        border-bottom: 1px solid #eeeeee;
        padding: 20px;
        display: flex;
        justify-content: space-between;
        align-items: center;
        .left {
            display: flex;
            justify-content: flex-start;
            align-items: center;
            .searchInput {
                width: 300px;
                margin-right: 10px;
            }
            span {
                color: #999999;
                font-size: 12px;
                margin-left: 10px;
            }
        }
    }
    .table {
        padding: 20px;
    }
}
</style>
